package com.photoeditor.demo.model.image.collage.templet;


import com.photoeditor.R;

/**
 * 定义宽高的比例
 */
public class Ratio {

    public enum RATIO {
        RATIO_1_1, RATIO_4_5, RATIO_4_3, RATIO_2_1, RATIO_2_3, RATIO_COVER, RATIO_16_9, RATIO_9_16, RATIO_3_4,
    }

    public static final int RATIO_RES[] = new int[]{
            R.drawable.ic_crop_ig_1_1,
            R.drawable.ic_crop_ig_4_5,
            R.drawable.ic_crop_fb_4_3,
            R.drawable.ic_crop_twi_2_1,
            R.drawable.ic_crop_pin_2_3,
            R.drawable.ic_crop_fb_820_312_cover,
            R.drawable.ic_crop_youtobe_16_9,
            R.drawable.ic_crop_9_16,
            R.drawable.ic_crop_3_4,
    };

    //宽高比
    public static final float SCALE_FACTOR[] = new float[]{
            1, 4f / 5, 4f / 3, 2f / 1, 2f / 3, 820f / 312, 16f / 9, 9f / 16, 3f / 4,
    };

    //宽高比
    public static final String SCALE_FACTOR_STRING[] = new String[]{
            "1:1", "4:5", "4:3", "2:1", "2:3", "Cover", "16:9", "9:16", "3:4"
    };

    public static String getStatisticName(RATIO ratio) {
        String name = "instgram_1_1";
        switch (ratio) {
            case RATIO_1_1:
                name = "instgram_1_1";
                break;
            case RATIO_4_5:
                name = "instgram_4_5";
                break;
            case RATIO_4_3:
                name = "facebook_4_3";
                break;
            case RATIO_2_1:
                name = "twitter_2_1";
                break;
            case RATIO_2_3:
                name = "pinterest_2_3";
                break;
            case RATIO_COVER:
                name = "facebook_cover_820_312";
                break;
            case RATIO_16_9:
                name = "youtobe_16_9";
                break;
            case RATIO_9_16:
                name = "9_16";
                break;
            case RATIO_3_4:
                name = "3_4";
                break;
        }
        return name;
    }
}
